/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package rentcalculator.persist;

import java.util.List;
import rentcalculator.model.Facility;

/**
 *
 * @author developer
 */
public class FacilityDao {
    public void add(Facility p){
        Persist.getInstance().add(p);
        
        
    }
    
    
    public void remove(Facility p){
        Persist.getInstance().remove(p);
    }
    
    public void update(Facility p){
        Persist.getInstance().update(p);
    }
    
    
    public List<Facility> findAll(){
        List<Facility> ps;
        ps = (List<Facility>)Persist.getInstance().findALL(Facility.class);
        
        return ps;
    }
    
    public Facility findById(long id){
        Object r;
        Facility p;
        p = null;
        r = Persist.getInstance().findById(Facility.class, id);
        if(r!= null) p = (Facility)r;
        return p;
    }
    
    
}
